import { createRouter, createWebHistory } from 'vue-router'
import { routes } from '@/router/routes'
import type { App } from 'vue'
import { setUpRouterGuard } from '@/router/guards'

export const router = createRouter({
	history: createWebHistory(),
	routes,
})

export function setUpRouter(app: App) {
	// 装载路由守卫相关
	setUpRouterGuard()

	app.use(router)
}
